
def palindrome?(string)
	string_word = string.gsub(/\W/,'').downcase
	string_word == string_word.reverse
end

def count_words(string)
	array =	string.gsub(/\W/,' ').downcase.split;
	hash_array = array.collect {|x| [x, array.count(x)]}	
	Hash[hash_array]


end



ARGV.each do |a|
	#puts(palindrome?(a))
	puts(count_words(a))
end
